<?php echo $html->css("screen/users.css");?>
<script>	  
	$(document).ready(function(){		
		$("#UserAddForm").validate({
			rules: {
				'data[User][email]': {
					required: true,
					email:true
				},
				'data[User][password]': {
					required: true,
					minlength: 3
				},
				'data[User][confirm_password]': {
					required: true,
					minlength: 3,
					equalTo:'#UserPassword'
				},				
				'data[User][first_name]': {
					required: true,
					minlength: 3
				},				
				'data[User][last_name]': {
					required: true,
					minlength: 3
				},				
				'data[User][company]': {
					required: true,
					minlength: 3
				},				
				'data[User][company_address]': {
					required: true,
					minlength: 3
				},				
				'data[User][city]': {
					required: true,
					minlength: 3
				},				
				'data[User][country_id]': {
					required: true
				},				
				'data[User][term]': {
					required: true
				}
			},
			messages: {			
				'data[User][email]': {
					required: "Please enter your email",
					email: "This email is not valid"
				},			
				'data[User][password]': {
					required: "Please enter password",
					minlength: "This password must consist of at least 3 characters",					
				},			
				'data[User][confirm_password]': {
					required: "Please enter password",
					minlength: "This password must consist of at least 3 characters",
					equalTo: "Please enter the same password as above"
				}
			}
		});
		$('.jqTransform').jqTransform({width:100});		
		$("#UserTerm").attr('checked',false);
		$("#Submit").attr('disabled',true);
		$("#UserTerm").change(function(){
			if($("#UserTerm").attr('checked')){
				$("#Submit").attr('disabled',false);
			}else{
				$("#Submit").attr('disabled',true);
			}
		});
	});	
</script>	
<div id="content" class="users form">
<?php echo $this->Form->create('User');?>	
	<?php
		echo $this->Form->input('email');
		echo $this->Form->input('first_name');
		echo $this->Form->input('last_name');		
		echo $this->Form->input('password');
		echo $this->Form->input('confirm_password',array('type'=>'password'));
		echo $this->Form->input('company');
		echo $this->Form->input('company_address');
		echo $this->Form->input('city');
		echo '<span class="jqTransform">';
		echo $this->Form->input('country_id');		
		echo '</span>';
		//echo $this->Form->input('reset_password');
		//echo $this->Form->input('reset_password_exprired');
	?>
	<div class="checkboxpanel" style="clear:both;">
		<div><?php echo $this->Form->input('buyer',array('div'=>false,'label'=>__('I want to buy printers',true)));?></div>
		<div><?php echo $this->Form->input('seller',array('div'=>false,'label'=>__('I want to sell printers',true)));?></div>
		<div><?php echo $this->Form->input('term',array('type'=>'checkbox','label'=>__('Terms and conditions',true),'div'=>false));?></div>
	</div>
	<div class="clear">
		<?php echo $form->submit(__('Register', true),array('class'=>'bt bt_save','id'=>'Submit','div'=>false));?>
	</div>
<?php echo $this->Form->end();?>
</div>